# -*- coding: utf-8 -*-
"""
______________________________
  Author: zcj
  Email : 1923425117@qq.com
   Time : 2024/1/25 0025 15:56
    File: FileUpload_convert.py
Software: PyCharm
______________________________
"""
import time

from common import read_config
from common.read_excel_handle import read_execl
from common.read_yaml import get_yaml_data
from common.single_convert import single_data_convert
from common.util import filename_all, FileUpload_path


def allcase_FileUpload():
    cases = []
    num = filename_all(FileUpload_path)  # 获取Api/data/BusinessFlow目录下所有文件名称
    if num:
        for filename in num:
            if filename.endswith('.yaml'):  # 判断文件的后缀名是否是yaml文件
                ta = get_yaml_data(FileUpload_path + f'/{filename}')["file"]  # 读取节点下全部数据
    
                cases.extend(ta)  # 把每个文件的数据添加到一个列表

        return cases
    else:

        print("文件上传目录下，不存在用例文件")

if __name__ == '__main__':
    print(allcase_FileUpload())